package com.ohuang.wallpapermanager.workmanager

import android.content.Context
import androidx.work.Worker
import androidx.work.WorkerParameters
import com.ohuang.wallpapermanager.config.LocalConfig
import com.ohuang.wallpapermanager.config.LogConfig
import com.ohuang.wallpapermanager.wallpaper.CarouselWallPaperDispatch

class CarouseWallPaperWork(context: Context, workerParams: WorkerParameters) :
    Worker(
        context,
        workerParams
    ) {
    override fun doWork(): Result {
        if (LocalConfig.isWorkManagerEnable){
            CarouselWallPaperDispatch.changeWallPaper()
        }
        LocalConfig.workManagerLastRunTime = System.currentTimeMillis()
        return Result.success()
    }
}